<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div style="padding: 15px;">
    <form action="/admin.php/order/sub_order_info2" id="form2" method="post">
    <table class="table table-bordered">
        <input type="hidden" name="id" value="<?php echo ($order['id']); ?>">
        <tr>
            <td colspan="4">订单编号：<?php echo ($order['orderid']); ?></td>
        </tr>
        <tr>
            <td>司机</td>
            <td>   
                <input type="text" name="openid" id="openid" placeholder="司机姓名或者手机号">
                 <div id="radiolist"></div>
                <!-- <span style="float:left;"><?php echo ($siji); ?></span>

                <select name="openid" class="input-sm select-md col-sm-4" style="padding:0 5px;">
                    <option value="">选择司机</option>
                    <?php if(is_array($sj)): $i = 0; $__LIST__ = $sj;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vp): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vp["openid"]); ?>"><?php echo ($vp["xingming"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                </select> -->
            </td>
            <!--<td>支付状态</td>-->
            <!--<td>-->
                <!--<?php if($vp['status'] < 5): ?>-->
                    <!--未支付-->
                    <!--<?php else: ?>-->
                    <!--<?php if($vp['pay_status_sk'] == 1): ?>-->
                        <!--现金支付-->
                        <!--<?php else: ?>-->
                        <!--线上支付-->
                    <!--<?php endif; ?>-->
                <!--<?php endif; ?>-->
            <!--</td>-->
            <td>姓名</td>
            <td><?php echo ($xm['name']); ?></td>
        </tr>
        <tr>
                <td>乘客电话</td>
                <td><input type="text" name="tel" value="<?php echo ($order['mobile']); ?>"></td>
                <td>出发地</td>
                <td><input type="text" name="start" value="<?php echo ($order['start']); ?>"></td>
            </tr>
        <tr>

            <td>目的地</td>
            <td><input type="text" name="end" value="<?php echo ($order['end']); ?>"></td>
            <td>下单时间</td>
            <td><input type="text" value="<?php echo (date('Y-m-d H:i:s',$order['addtime'])); ?>"></td>
        </tr>
        <tr>

            <td>出发时间</td>
            <td><input type="text" name="starttime" value="<?php echo ($order['starttime']); ?>"></td>
            <td>人数</td>
            <td>成人：<input type="text" name="num" value="<?php echo ($order['num']); ?>">人;</td>
        </tr>
        <tr>

            <td>金额</td>
            <td><input type="text" name="price" value="<?php echo ($order['price']); ?>"></td>
            <td>修改支付状态</td>
            <td>
                <select name="pay_statu" id="pay_statu">
                    <option value="0" <?php if($order['pay_statu'] == '0'): ?>selected = "selected"<?php endif; ?>>未支付</option>
                    <option value="1" <?php if($order['pay_statu'] == '1'): ?>selected = "selected"<?php endif; ?>>已支付</option>
                    <option value="999" <?php if($order['pay_statu'] == '999'): ?>selected = "selected"<?php endif; ?>>已退款</option>
                </select>
                <!-- <?php if($order['pay_statu'] == '0'): ?>未支付
                    <?php elseif($order['pay_statu'] == '1'): ?>
                    已支付
                    <?php elseif($order['pay_statu'] == '999'): ?>
                    <font color="red">已退款</font><?php endif; ?> -->
            </td>
        </tr>
        <tr>

            <td>订单类型</td>
            <td><input type="text" name="fs" value="<?php echo ($order['fs']); ?>"></td>
            <td>备注</td>
            <td><input type="text" name="crc" value="<?php echo ($order['crc']); ?>"></td>
        </tr>

        <?php if($order['pay_statu'] != '0'): ?><tr>
            <!-- <td>退款</td> -->
            <!-- <td colspan="3">请输入退款金额:<input type="text" id="tk_price" value=""><a onclick="tuikuan(<?php echo ($payinfo['id']); ?>)">退款</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已退款金额<?php echo ($order['tk_price']); ?></td> -->

        </tr><?php endif; ?>
      <a href="javascript:void(0)" id="sub_order" class="btn btn-primary" style="position:absolute;right: 50px;top: 10px;">确认修改</a>
    </table>
    </form>
</div>
<script>
        $("#sub_order").click(function(){
            $("#form2").submit();
        })

        function tuikuan(id) {
        if(confirm("退款操作不可逆？确认操作吗"))
        {
            var price=$('#tk_price').val();
            $.ajax({
                type: "POST",
                url: "/admin.php/order/tuikuan",

                cache: false,
                dataType: "json",
                async: false,
                data: {
                    id: id,
                    price:price
                },

                success: function (data) {
                    alert(data);
                    ////
                }


            });
        }else{
            return false;
        }
    }



    $("#openid").blur(function(){
       
        $("#radiolist").empty();
        var xingming    = $(this).val();
        $.post("<?php echo U('Order/selectname');?>",{name:xingming},function(data){
            datajson = $.parseJSON(data);
            if(datajson.code==0)
            {
                alert(datajson.msg);return false;
            }
            $.each(datajson.result,function(key,value){
                var html='<input type="radio" name="openid" value ="'+value['openid']+'">'+value['xingming']+':'+value['dianhua']+'<br>';
                $('#radiolist').append(html);
            })
        })
    });
</script>
</body>
</html>